<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/kobject_ns.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/kobject_ns.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="k">/* Kernel object name space definitions</span>
<a name="2" /><span class="True">       2:</span> <span class="k"> *</span>
<a name="3" /><span class="True">       3:</span> <span class="k"> * Copyright (c) 2002-2003 Patrick Mochel</span>
<a name="4" /><span class="True">       4:</span> <span class="k"> * Copyright (c) 2002-2003 Open Source Development Labs</span>
<a name="5" /><span class="True">       5:</span> <span class="k"> * Copyright (c) 2006-2008 Greg Kroah-Hartman &lt;greg@kroah.com&gt;</span>
<a name="6" /><span class="True">       6:</span> <span class="k"> * Copyright (c) 2006-2008 Novell Inc.</span>
<a name="7" /><span class="True">       7:</span> <span class="k"> *</span>
<a name="8" /><span class="True">       8:</span> <span class="k"> * Split from kobject.h by David Howells (dhowells@redhat.com)</span>
<a name="9" /><span class="True">       9:</span> <span class="k"> *</span>
<a name="10" /><span class="True">      10:</span> <span class="k"> * This file is released under the GPLv2.</span>
<a name="11" /><span class="True">      11:</span> <span class="k"> *</span>
<a name="12" /><span class="True">      12:</span> <span class="k"> * Please read Documentation/kobject.txt before using the kobject</span>
<a name="13" /><span class="True">      13:</span> <span class="k"> * interface, ESPECIALLY the parts about reference counts and object</span>
<a name="14" /><span class="True">      14:</span> <span class="k"> * destructors.</span>
<a name="15" /><span class="True">      15:</span> <span class="k"> */</span>
<a name="16" /><span class="True">      16:</span> 
<a name="17" /><span class="Maybe">      17:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_X0xJTlVYX0tPQkpFQ1RfTlNfSF8w"><span class="b">_LINUX_KOBJECT_NS_H</span></a>
<a name="18" /><span class="Maybe">      18:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X0xJTlVYX0tPQkpFQ1RfTlNfSF8w"><span class="b">_LINUX_KOBJECT_NS_H</span></a>
<a name="19" /><span class="Maybe">      19:</span> 
<a name="20" /><span class="Maybe">      20:</span> <span class="m">struct</span> <span class="b">sock</span><span class="f">;</span>
<a name="21" /><span class="Maybe">      21:</span> <span class="m">struct</span> <span class="b">kobject</span><span class="f">;</span>
<a name="22" /><span class="Maybe">      22:</span> 
<a name="23" /><span class="Maybe">      23:</span> <span class="k">/*</span>
<a name="24" /><span class="Maybe">      24:</span> <span class="k"> * Namespace types which are used to tag kobjects and sysfs entries.</span>
<a name="25" /><span class="Maybe">      25:</span> <span class="k"> * Network namespace will likely be the first.</span>
<a name="26" /><span class="Maybe">      26:</span> <span class="k"> */</span>
<a name="27" /><span class="Maybe">      27:</span> <span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="f">{</span>
<a name="28" /><span class="Maybe">      28:</span>     <span class="b">KOBJ_NS_TYPE_NONE</span> <span class="f">=</span> <span class="c">0</span><span class="f">,</span>
<a name="29" /><span class="Maybe">      29:</span>     <span class="b">KOBJ_NS_TYPE_NET</span><span class="f">,</span>
<a name="30" /><span class="Maybe">      30:</span>     <span class="b">KOBJ_NS_TYPES</span>
<a name="31" /><span class="Maybe">      31:</span> <span class="f">}</span><span class="f">;</span>
<a name="32" /><span class="Maybe">      32:</span> 
<a name="33" /><span class="Maybe">      33:</span> <span class="k">/*</span>
<a name="34" /><span class="Maybe">      34:</span> <span class="k"> * Callbacks so sysfs can determine namespaces</span>
<a name="35" /><span class="Maybe">      35:</span> <span class="k"> *   @grab_current_ns: return a new reference to calling task&apos;s namespace</span>
<a name="36" /><span class="Maybe">      36:</span> <span class="k"> *   @netlink_ns: return namespace to which a sock belongs (right?)</span>
<a name="37" /><span class="Maybe">      37:</span> <span class="k"> *   @initial_ns: return the initial namespace (i.e. init_net_ns)</span>
<a name="38" /><span class="Maybe">      38:</span> <span class="k"> *   @drop_ns: drops a reference to namespace</span>
<a name="39" /><span class="Maybe">      39:</span> <span class="k"> */</span>
<a name="40" /><span class="Maybe">      40:</span> <span class="m">struct</span> <span class="b">kobj_ns_type_operations</span> <span class="f">{</span>
<a name="41" /><span class="Maybe">      41:</span>     <span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">;</span>
<a name="42" /><span class="Maybe">      42:</span>     <span class="m">bool</span> <span class="f">(</span><span class="f">*</span><span class="b">current_may_mount</span><span class="f">)</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="43" /><span class="Maybe">      43:</span>     <span class="m">void</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="b">grab_current_ns</span><span class="f">)</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="44" /><span class="Maybe">      44:</span>     <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="b">netlink_ns</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">sock</span> <span class="f">*</span><span class="b">sk</span><span class="f">)</span><span class="f">;</span>
<a name="45" /><span class="Maybe">      45:</span>     <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="b">initial_ns</span><span class="f">)</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="46" /><span class="Maybe">      46:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">drop_ns</span><span class="f">)</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="47" /><span class="Maybe">      47:</span> <span class="f">}</span><span class="f">;</span>
<a name="48" /><span class="Maybe">      48:</span> 
<a name="49" /><span class="Maybe">      49:</span> <span class="m">int</span> <span class="b">kobj_ns_type_register</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">kobj_ns_type_operations</span> <span class="f">*</span><span class="b">ops</span><span class="f">)</span><span class="f">;</span>
<a name="50" /><span class="Maybe">      50:</span> <span class="m">int</span> <span class="b">kobj_ns_type_registered</span><span class="f">(</span><span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">)</span><span class="f">;</span>
<a name="51" /><span class="Maybe">      51:</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">kobj_ns_type_operations</span> <span class="f">*</span><span class="b">kobj_child_ns_ops</span><span class="f">(</span><span class="m">struct</span> <span class="b">kobject</span> <span class="f">*</span><span class="b">parent</span><span class="f">)</span><span class="f">;</span>
<a name="52" /><span class="Maybe">      52:</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">kobj_ns_type_operations</span> <span class="f">*</span><span class="b">kobj_ns_ops</span><span class="f">(</span><span class="m">struct</span> <span class="b">kobject</span> <span class="f">*</span><span class="b">kobj</span><span class="f">)</span><span class="f">;</span>
<a name="53" /><span class="Maybe">      53:</span> 
<a name="54" /><span class="Maybe">      54:</span> <span class="m">bool</span> <span class="b">kobj_ns_current_may_mount</span><span class="f">(</span><span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">)</span><span class="f">;</span>
<a name="55" /><span class="Maybe">      55:</span> <span class="m">void</span> <span class="f">*</span><span class="b">kobj_ns_grab_current</span><span class="f">(</span><span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">)</span><span class="f">;</span>
<a name="56" /><span class="Maybe">      56:</span> <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">kobj_ns_netlink</span><span class="f">(</span><span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">,</span> <span class="m">struct</span> <span class="b">sock</span> <span class="f">*</span><span class="b">sk</span><span class="f">)</span><span class="f">;</span>
<a name="57" /><span class="Maybe">      57:</span> <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">kobj_ns_initial</span><span class="f">(</span><span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">)</span><span class="f">;</span>
<a name="58" /><span class="Maybe">      58:</span> <span class="m">void</span> <span class="b">kobj_ns_drop</span><span class="f">(</span><span class="m">enum</span> <span class="b">kobj_ns_type</span> <span class="b">type</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">ns</span><span class="f">)</span><span class="f">;</span>
<a name="59" /><span class="Maybe">      59:</span> 
<a name="60" /><span class="True">      60:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* _LINUX_KOBJECT_NS_H */</span>
<a name="61" /><span class="True">      61:</span> </pre>
  </body>
</html>
